import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView'
import KJManage from '../views/KJManage'
import Login from '../views/Login'
import ResourceList from '../views/ResourceList'
import ClassDirResourceList from '../views/ClassDirResourceList'
import ResourceSelect from '../views/ResourceSelect'
import NoticeList from '../views/NoticeList'
import AllClassNotice from '../views/AllClassNotice'
import ClassStuList from '../views/ClassStuList'
import AllClassesList from '../views/AllClassesList'
import AllStudentList from '../views/AllStudentList'
import AllTeacherList from '../views/AllTeacherList'
import ClassAndNoticeList from '../views/ClassAndNoticeList'
import ClassesList from '../views/ClassesList'
import CourseList from '../views/CourseList'
import UpdateTeacher from '../views/UpdateTeacher'
import KJStudent from '../views/KJStudent'
import KJTeacher from '../views/KJTeacher'
import UpdateStudent from '../views/UpdateStudent'
import CourseDirectory from '../views/CourseDirectory'
import TestKJStudent from '../views/TestKJStuent'
import MyClasses from "../views/MyClasses";
import ClassAllStuList from "../views/ClassAllStuList";
import StuListSelect from "../views/StuListSelect";

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: '主页面',
        show: true,
        icon: 'el-icon-goods',
        redirect: '/kJManage',
        component: HomeView,
        children: [

            {
                //无用
                path: '/kJStudent',
                name: '学生主页面',
                show: false,
                icon: 'el-icon-goods',
                component: KJStudent
            },
            {
                //教师主页面
                path: '/kJTeacher',
                name: '教师主页',
                show: true,
                allow: [1],
                icon: 'el-icon-goods',
                component: KJTeacher
            },
            {
                // 管理员界面
                path: '/kJManage',
                name: '主页',
                show: true,
                allow: [0],
                icon: 'el-icon-goods',
                component: KJManage
            },
            {
                path: '/noticeList',
                name: '通知',
                show: false,
                icon: 'el-icon-goods',
                component: NoticeList
            },
            {
                //所有班级通知
                path: '/allClassNotice',
                name: '班级通知',
                show: true,
                allow: [0],
                icon: 'el-icon-goods',
                component: AllClassNotice
            },
            {
                path: '/classAndNoticeList',
                name: '学生通知',
                show: false,
                icon: 'el-icon-goods',
                component: ClassAndNoticeList
            },
            {
                path: '/classesList',
                name: '班级列表',
                show: true,
                allow: [1],
                icon: 'el-icon-goods',
                component: ClassesList
            },
            {
                path: '/courseList',
                name: '课程列表',
                show: true,
                allow: [0],
                icon: 'el-icon-goods',
                component: CourseList
            },
            {
                path: '/resourceList',
                name: '资源列表',
                show: true,
                allow: [0, 1],
                icon: 'el-icon-goods',
                component: ResourceList
            },
            {
                //无用
                path: '/classDirResourceList',
                name: '课程目录资源列表',
                show: false,
                icon: 'el-icon-goods',
                component: ClassDirResourceList
            },
            {
                //老师分班学生管理
                path: '/classStuList',
                name: '学生管理',
                show: true,
                allow: [1],
                icon: 'el-icon-goods',
                component: ClassStuList
            },
            {
                //管理员所有班级列表
                path: '/allClassesList',
                name: '所有班级列表',
                show: true,
                allow: [0],
                icon: 'el-icon-goods',
                component: AllClassesList
            },
            {
                //管理员所有老师列表
                path: '/allTeacherList',
                name: '所有老师列表',
                show: true,
                allow: [0],
                icon: 'el-icon-goods',
                component: AllTeacherList
            },
            {
                //管理员所有学生列表
                path: '/allStudentList',
                name: '所有学生列表',
                show: true,
                allow: [0],
                icon: 'el-icon-goods',
                component: AllStudentList
            },
            {
                path: '/resourceSelect',
                name: '资源选择列表',
                show: false,
                icon: 'el-icon-goods',
                component: ResourceSelect
            },
            {
                path: '/updateTeacher',
                name: '教师修改信息',
                show: false,
                icon: 'el-icon-goods',
                component: UpdateTeacher
            },
            {
                path: '/updateStudent',
                name: '学生修改信息',
                show: false,
                icon: 'el-icon-goods',
                component: UpdateStudent
            },
            {
                path: '/testKJStudent',
                name: '学生框架测试主页面',
                show: false,
                icon: 'el-icon-goods',
                component: TestKJStudent
            },
            {
                //学生主页面
                path: '/myClasses',
                name: '学生主页',
                show: true,
                allow: [2],
                icon: 'el-icon-goods',
                component: MyClasses
            }, {
                path: '/courseDirectory',
                name: '课程目录',
                show: false,
                icon: 'el-icon-goods',
                component: CourseDirectory
            },
            {
                //管理员班级学生管理'
                path: '/classAllStuList',
                name: '班级管理',
                show: false,
                icon: 'el-icon-goods',
                component: ClassAllStuList
            },
            {
                //学生选择写界面
                path: '/stuListSelect',
                name: '学生选择界面',
                show: false,
                icon: 'el-icon-goods',
                component: StuListSelect
            },

        ]
    }, {
        path: '/login',
        name: '登录',
        show: false,
        icon: 'el-icon-goods',
        component: Login
    },
]

const router = new VueRouter({
    mode: 'history', // 配置路由模式
    base: process.env.BASE_URL,
    routes
})

export default router
